#ifndef _STARFIELD_H_
#define _STARFIELD_H_

#include "sdl_surface.h"
#include "sdl_event.h"
#include "sdl_exception.h"
#include "sdl_timer.h"
#include "star.h"

class StarField
	: public sdl::SurfaceListener
	, public sdl::EventListener
	, private sdl::Timer
{
public:
	StarField() throw (sdl::Exception);
	virtual ~StarField();

private:
	// Callback methods
	void on(sdl::SurfaceListener::Update, sdl::Surface*) throw();
	void on(sdl::EventListener::NewEvent, const SDL_Event*) throw();

	// Timer function
	Uint32 onTimer(Uint32 interval);

	Star::List _stars;
};

#endif // _STARFIELD_H_
